/**
 * Copyright 厦门中软海晟信息技术有限公司 版权所有 违者必究 2019
 */
package com.leetCode;

/**
 * @author : sunzb
 * @date: 2019/5/15
 */
public class _25_191_NumberOf1Bits {

    public int hammingWeight(int n) {
        int count = 0;
        for (; n != 0 ; n = n & n - 1) count++;
        return count;
    }

    public static void main(String[] args) {
        System.out.println(new _25_191_NumberOf1Bits().hammingWeight(0));
    }
}
